﻿using System;
using System.Collections.Generic;
using System.Web;
using ORS.DAL;

namespace ORS.BLL
{
    public class roleselect
    {
         string sRole ;
         string sqlstr1;
         DBHelper dRole;
         object oRole;  

         public roleselect()
         {
             sRole = "";
             dRole = new DBHelper();
          }

     public string SelectRole(string username)
        {
            sqlstr1 = "SELECT tb_role.name FROM tb_userlist INNER JOIN tb_role ON tb_userlist.roleid = tb_role.roleid WHERE tb_userlist.userid = '" + username + "'";
            oRole = dRole.GetRoleName(sqlstr1);
            if (oRole != null)
            {
                sRole = oRole.ToString();
            }
            else
            {
                sRole = "";
            }

            return sRole;
        }
    }
}